<template>
	<view class="foottab-row">
		<view class="foottab" v-for="(item, index) in footerList" :key="index">
			<view class="left-fav" @click="toKeFu">
				<view class="fav-img">
					<image src="../../static/img/ios/kefu.png" mode="aspectFit"></image>
				</view>
				<view class="fav-text">客服</view>
			</view>
			<view class="center-seller" @click="goSeller(item)">
				<view class="seller-wl">￥{{ item.wlPrice }}</view>
				<view class="seller-go" v-if="item.sellerGo == '去京东比价'">{{ item.sellerGo }}</view>
				<view class="seller-go" v-else>去{{ item.sellerGo }}购买</view>
			</view>
			<view class="right-buy" @click="goChange">
				<view class="buy-wl">￥{{ item.wlPrice_after }}</view>
				<view class="buy-go">兑换购买</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			footerList: Array
		},
		methods: {
			goSeller(e) {
				this.$emit('goSeller', e);
			},
			goChange() {
				this.$emit('goChange');
			},
			toKeFu() {
				let mobile = uni.getStorageSync('mobile');
				if (mobile != '' && mobile != 'null' && mobile != null && mobile != undefined && mobile !=
					'undefined') {
					console.log("go to ke fu mobile==" + mobile);
					const href = 'https://www.sobot.com/chat/h5/index.html?sysNum=fa572952b4844731849016f4bbfd4bfe&tel=' +
						mobile + '&uname=' + mobile;
					// appNavigateTo(href);
					window.appNavigateTo(href);
					// appNavigateTo(href);
				} else {
					window.onStartLogin();
				}
			}
		}
	};
</script>

<style lang="scss">
	.foottab-row {
		position: fixed;
		left: 0;
		bottom: 0;
		overflow: scroll;
		width: 100%;
		height: 110px;
		// line-height: 110px;
		z-index: 1010;
		min-width: 700px;

		/* border: #ef4158 1px solid; */
		.foottab {
			width: 100%;
			height: 100%;
			display: flex;
			justify-content: space-between;
			font-size: 28px;

			/* margin-top: -160px; */
			.left-fav {
				width: 20%;
				background-color: white;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;

				.fav-img {
					padding-top: 12px;
					width: 30px;
					height: 40px;

					image {
						width: 30px;
						height: 30px;
					}
				}
			}

			.center-seller {
				width: 30%;
				/* height: 120px;
                line-height: 120px; */
				color: white;
				background-color: #1f1f1f;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;

				.seller-wl {
					height: 40px;
					display: flex;
					align-items: center;
					padding-top: 10px;
				}

				.seller-go {
					height: 40px;
					display: flex;
					align-items: center;
				}
			}

			.right-buy {
				/* width: 50%; */
				width: 50%;
				/* height: 120px;
                line-height: 120px; */
				color: white;
				background: linear-gradient(to right, #ff4964, #ff7665);
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;

				.buy-wl {
					height: 40px;
					display: flex;
					align-items: center;
					padding-top: 10px;
				}

				.buy-go {
					height: 40px;
					display: flex;
					align-items: center;
				}
			}
		}
	}
</style>
